<h3>Upload de photos pour la gallery <?php echo $gallery->getTitle() ?></h3>

<p>
  <?php echo link_to('retour aux images', 'gallery/view?gallery_id='.$gallery->getId()) ?>
</p>

<script type="text/javascript">
		//<![CDATA[

		/**
		 * Sample Data
		 */

		window.addEvent('load', function()
		{
			/**
			 * We take the first input with this class we can find ...
			 */
			var input = $('photoupload-filedata-1');

			/**
			 * Simple and easy
			 * 
			 * swf: the path to the swf
			 * container: the object is embedded in this container (default: document.body)
			 * 
			 * NOTE: container is only used for the first uploader u create, all others depend
			 * on the same swf in that container, so the container option for the other uploaders
			 * will be ignored.
			 * 
			 */
			var uplooad = new FancyUpload(input, {
				swf: 'http://dev.hacride.com/admin/swf/Swiff.Uploader.swf',
				queueList: 'photoupload-queue',
				container: $E('h4')
			});

			/**
			 * We create the clear-queue link on-demand, since we don't know if the user has flash/javascript.
			 * 
			 * You can also create the complete xhtml structure thats needed for the queue here, to be sure
			 * that its only in the document when the user has flash enabled.
			 */
			$('photoupload-status').adopt(new Element('a', {
				href: 'javascript:void(null);',
				events: {
					click: uplooad.clearList.bind(uplooad, [false])
				}
			}).setHTML('Nettoyer la liste'));


		});

		//]]>
</script>
<div id="container">
		<h4>
			&nbsp;
		</h4>

		<form action="<?php echo url_for('gallery/upload?gallery_id='.$gallery->getId()) ?>" method="post" id="photoupload" enctype="multipart/form-data">
			<div class="halfsize">
				<fieldset>
					<legend>Select Files</legend>

					<div class="note">
						Les photos selectionnées seront ajoutés à la file d'attente.<br />

						Options: <b>Sélection multipes en laissant la touche Ctrl enfoncée <i></i></b>.
					</div>

					<div class="label emph">
						<label for="photoupload-filedata-1">
							Upload Photos:
							<span>Aprés avoir sélectionné les photos, cliquer sur le bouton 'start upload'</span>
						</label>

						<input type="file" name="Filedata" id="photoupload-filedata-1" />
					</div>

				</fieldset>
			</div>
			<div class="halfsize">
				<fieldset>
					<legend>File d'attente</legend>

					<div class="note" id="photoupload-status">
						
					</div>

					<ul class="photoupload-queue" id="photoupload-queue">
						<li style="display: none" />
					</ul>
				</fieldset>
			</div>

			<div class="clear"></div>

			<div class="footer">
				<input type="submit" class="submit" id="profile-submit" value="Start Upload"/>
			</div>
		</form>
		
</div>